import 'package:app/pages/home_module/home_view.dart';
import 'package:app/pages/sign_in_module/sign_page.dart';
import 'package:app/utils/persisten_storage.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import '../../common/colors.dart';
import 'attendance_record_view.dart';


class SignBottomControllerView extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    return SignBottomControllerViewState();
  }
}

class SignBottomControllerViewState extends State<SignBottomControllerView>{

  int _currentIndex = 0;
  final List _listPageData = [ //页面集合
   SignPage(),
    AttendanceRecordView(),
  ];
  @override


  Widget build(BuildContext context) {
    return Scaffold(
      body: _listPageData[_currentIndex],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: this._currentIndex,//配置对应的索引值选中
        onTap: (int index){//index 表示选择选项
          setState(() {
            this._currentIndex = index;//改变页面
          });
        },
        iconSize: 20.0,//icon的大小
        fixedColor: AppColor.themeColor,//选中颜色
        selectedFontSize: 12,
        type: BottomNavigationBarType.fixed,
        items: [
          BottomNavigationBarItem(
              icon:Image.asset('images/sign_bottom_icon.png',width: 20,height: 20,),
              activeIcon: Image.asset('images/sign_bottom_icon.png',width: 20,height: 20,color: AppColor.themeColor,),
              label: '考勤签到'
          ),
          BottomNavigationBarItem(
              icon:Image.asset('images/kaoqin_icon.png',width: 20,height: 20,),
              activeIcon: Image.asset('images/kaoqin_icon.png',width: 20,height: 20,color: AppColor.themeColor,),
              label: '出勤记录'
          ),
        ],
      ),
    );
  }
}